<?php

namespace App\Events;

use Illuminate\Broadcasting\Channel;
use Illuminate\Queue\SerializesModels;
use Illuminate\Broadcasting\PrivateChannel;
use Illuminate\Broadcasting\PresenceChannel;
use Illuminate\Broadcasting\InteractsWithSockets;
use Illuminate\Contracts\Broadcasting\ShouldBroadcast;

class NoticeUserEvent
{
    use InteractsWithSockets, SerializesModels;
    public $sumupUserId;//读书改进计划要通知的用户的ID
    public $commentUserId;//评论用户的ID
    public $sumUpId;
    public $readPartyId;
    public $userName;
    public $avg;
    public $content;

    /**
     * Create a new event instance.
     *
     * @param $sumupUserId
     * @param null $commentUserId
     * @param $sumUpId
     * @param $readPartyId
     * @param $userName
     * @param $avg
     * @param $content
     */
    public function __construct($sumupUserId = null, $commentUserId = null, $sumUpId, $readPartyId, $userName, $avg, $content)
    {

        $this->sumupUserId   = $sumupUserId;
        $this->commentUserId = $commentUserId;
        $this->sumUpId       = $sumUpId;
        $this->readPartyId   = $readPartyId;
        $this->userName      = $userName;
        $this->avg           = $avg;
        $this->content       = $content;
    }

    /**
     * Get the channels the event should broadcast on.
     *
     * @return Channel|array
     */
    public function broadcastOn()
    {
        return new PrivateChannel('channel-name');
    }
}
